from datetime import timedelta, datetime

from monitor_tasks.celery import app


app.conf.beat_schedule = {
    'prepare_devices_task-every-1-minutes': {
        'task': 'monitor_tasks.fetch_monitoring_data.fetch_device_status_tasks.scan_device_task',  # 定时采集监控数据
        'schedule': timedelta(minutes=1),  # 每30秒执行一次
        'args': (),
    },
    'scan_all_user_token-every-1-hours': {
        'task': 'monitor_tasks.fetch_monitoring_data.fetch_device_info_tasks.scan_all_user_token',  # 定时刷新设备token
        'schedule': timedelta(hours=1),  # 每1小时执行一次
        'args': (),
    },
}
